Back to Mathematic

One-Time Pad Cipher

What is a One-Time Pad (OTP) Cipher?

One-Time Pad is a special encryption method that provides perfect secrecy when used correctly. It's essentially identical to the Vernam cipher, where each character of plaintext is combined with a corresponding character from a random key that's used only once. When implemented properly with truly random keys, it is mathematically proven to be unbreakable.

Key Requirements:

   1. The key must be truly random
   2. The key must be at least as long as the message
   3. The key must never be reused
   4. The key must be kept completely secret
   5. The key must be shared securely between parties

Encryption & Decoration Process:

   1. Each plaintext letter combined with key letter
   2. Usually uses modulo 26 for letters (A=0 to Z=25)
   3. Convert result back to letters

Example:

Message: SECRET
Key: RANDOM
   • S(18) + R(17) = 35 mod 26 = 9 = J
   • E(4) + A(0) = 4 = E
   • C(2) + N(13) = 15 = P
   • R(17) + D(3) = 20 = U
   • E(4) + O(14) = 18 = S
   • T(19) + M(12) = 31 mod 26 = 5 = F
Result: "SECRET " → "JEPUSF"

Video for explanation